﻿using System.Collections.Concurrent;

namespace woaC2.Common
{
    public class CCUDictionary<Tkey, Tval> : ConcurrentDictionary<Tkey, Tval>
    {

        public void Add(Tkey key, Tval val)
        {
            if (!this.ContainsKeys(key))
                base.TryAdd(key, val);
        }

        public void Remove(Tkey key)
        {
            Tval val;
            if (this.ContainsKeys(key))
                base.TryRemove(key, out val);
        }

        public bool ContainsKeys(Tkey key)
        {
            return base.ContainsKey(key);
        }
    }
}
